package easymall.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import easymall.po.Category;
import easymall.po.Products;
import easymall.pojo.MyPage;

@Repository("productsDao")
@Mapper
public interface ProductsDao {
	public List<Category> allcategorys();
	
	public List<Products> prodlist(Map<String, Object> map);
	
	public Products oneProduct(String pid);
	
	public List<Products> proclass(Integer category);
	
	public Object findByImgurl(String imgurl);
	
	public void save(Products products);
	
	//根据页号获取分类
	public List<Category> getCategorysByPage(MyPage mypage);
	
	//获取总分类数
	public int getCategorysCount();
	
	//商品分类
	public int checkCategorysExist(String name); //检查是否存在
	public int updateCategory(Category category); //更新
	public int saveCategory(String name);  //新增
	public int delCategory(Integer id); //删除某个类别
	
	
	//商品
	public int updatePruduct(Products products); //更新
	public int delProduct(String id); //删除某个商品
	public List<Products> getProductsByPage(MyPage mypage); //根据页号获取商品
	public int getProductsCount();
}
